import { TableColumnsType, Tooltip } from 'antd'
import type { ITableDataSKU } from './types'
export const useSkuColumns = (): TableColumnsType<ITableDataSKU> => [
  {
    title: '商品条码',
    dataIndex: 'skuInfoVOS',
    key: 'skuCode',
    align: 'center',
    width: 120,
    render: (info, rows) => {
      return rows?.skuCode || '-'
    },
  },
  {
    title: '款式编码',
    dataIndex: 'spuCode',
    key: 'spuCode',
    align: 'center',
    width: 80,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '商品名称',
    dataIndex: 'spuName',
    key: 'spuName',
    align: 'center',
    width: 160,
    ellipsis: {
      showTitle: false,
    },
    render: (info) => {
      return info ? (
        <Tooltip placement="top" title={info}>
          {info}
        </Tooltip>
      ) : (
        '-'
      )
    },
  },
  {
    title: '商品系列',
    dataIndex: 'productSeries',
    key: 'productSeries',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '风格',
    dataIndex: 'styleCode',
    key: 'styleCode',
    align: 'center',
    width: 120,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '助记码',
    dataIndex: 'designCode',
    key: 'designCode',
    align: 'center',
    width: 100,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '颜色',
    dataIndex: 'colorDetailName',
    key: 'colorDetailName',
    align: 'center',
    width: 80,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '尺码',
    dataIndex: 'size',
    key: 'size',
    align: 'center',
    width: 80,
    render: (info) => {
      return info || '-'
    },
  },
  {
    title: '吊牌价',
    dataIndex: 'originSalePrice',
    key: 'originSalePrice',
    align: 'center',
    width: 80,
    render: (info) => {
      return info || '-'
    },
  },
]
